
package com.lemon.cloud.comm.constants.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @date 2020-02-17
 * <p>
 * 菜单类型
 */
@Getter
@RequiredArgsConstructor
public enum MenuTypeEnum {

	/**
	 * 左侧菜单
	 */
	LEFT_MENU("0", "left"),

	/**
	 * 应用菜单
	 */
	TOP_MENU("2", "top"),

	/**
	 * 按钮
	 */
	BUTTON("1", "button");

	/**
	 * 类型
	 */
	private final String type;

	/**
	 * 描述
	 */
	private final String description;

	public static String getTypeByDesc(String description){
		if (StrUtil.isEmpty(description)){return null;}
		for (MenuTypeEnum e:values()){
			if (e.description.equals(description)){
				return e.type;
			}
		}
		return null;
	}
}
